const express = require('express')

const app = express()

// 跨域
// app.use((req, res, next) => {
//     res.append('Access-Control-Allow-Origin', '*')
//     res.append('Access-Control-Allow-Content-Type', '*')
//     next()
// })

app.get('/', (req, res) => {
    res.json({
        msg: '这是首页'
    })
})

app.get('/banner', (req, res) => {
    res.json({
        msg: '这是banner'
    })
})

app.listen(8000, () => {
    console.log('http://localhost:8000')
})